package com.test.pdproject.controller;

import com.test.pdproject.constant.Page;
import com.test.pdproject.constant.PageData;
import com.test.pdproject.service.BankService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import java.util.List;

/**
 * @description: 测试银行卡查询
 * @author: 李赛赛
 * @create: 2018-08-14 11:13
 **/
@Controller
@RequestMapping(value = "/bank")
public class BankController extends BaseController {
    @Resource
    private BankService bankService;
    /**
     * currentPage 当前页
     * setShowCount 总页数
     * @param page
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/all")
    public ModelAndView findBank(Page page) throws Exception {
        ModelAndView mode = new ModelAndView();
        page.setShowCount(5);
        List<PageData> pageData = bankService.searchlistPage(page);
        mode.setViewName("view/bank");
//        mv.setViewName("redirect:/coupon/all?id=" + pd.get("ShopId"));
        mode.addObject("banklist", pageData);
        System.out.println(pageData.toString());
        return mode;
    }
}
